package com.lzh.web;

import com.lzh.info.OrderInfo;
import com.lzh.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@CrossOrigin//跨域访问
@RequestMapping("/order")
public class WfwOrderController {

    @Autowired
    OrderService orderService;

    //添加订单
    @RequestMapping("/add")
    public String addOrder(@RequestBody OrderInfo orderInfo){
        System.out.println(orderInfo);
        return String.valueOf(orderService.createOrder(orderInfo));
    }
}
